﻿<src:IWpfConfiguration x:Class="ArduinoModules.Wpf.ArduinoEventConfig"                                       
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:src="clr-namespace:MayhemDefaultStyles.UserControls;assembly=MayhemDefaultStyles"
             xmlns:ext="clr-namespace:ArduinoModules.Wpf"
             Width="400" IsVisibleChanged="IWpfConfiguration_IsVisibleChanged"
             Name="root">
    <Grid>
        <StackPanel>
            <StackPanel Orientation="Vertical">
                <Label>Select COM port on which an Arduino is connected:</Label>
                <StackPanel Orientation="Horizontal">
                    <ComboBox Name="deviceList" Width="200"></ComboBox>
                    <Button Name="connectButton" Margin="10 0 0 0" Click="Button_Click">Connect</Button>         
                </StackPanel>
                <ScrollViewer VerticalScrollBarVisibility="Visible" MaxHeight="500">
                    <StackPanel Orientation="Vertical">
                        <!-- Data Grid for Digital Pins -->
                        <Label>Monitor Digital Pin Changes:</Label>
                        <DataGrid ext:DataGridColumns.Stretch="True" Width="350" Name="digitalPins" AutoGeneratingColumn="digitalPins_AutoGeneratingColumn" AutoGeneratedColumns="digitalPins_AutoGeneratedColumns" Visibility="Hidden">                   
                        </DataGrid>
                        <Label>Monitor Analog Pin Changes:</Label>
                        <DataGrid  MaxWidth="350" Name="analogPins" AutoGeneratingColumn="analogPins_AutoGeneratingColumn" AutoGeneratedColumns="analogPins_AutoGeneratedColumns" Visibility="Hidden">
                        
                        </DataGrid>
                    </StackPanel>
                    
                    
                    
                    <!-- switching to a datagrid <StackPanel Orientation="Vertical"> -->
                        <!-- Digital Pins
                     
                        <ItemsControl  BorderThickness="0" Name="digitalPins" Width="400"  ItemsSource="{Binding ElementName=root, Path=digital_pin_items}">
                            <ItemsControl.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel Orientation="Vertical"></StackPanel>
                                </ItemsPanelTemplate>
                            </ItemsControl.ItemsPanel>
                            <ItemsControl.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <CheckBox IsChecked="{Binding Path=isChecked}"></CheckBox>
                                        <Label>Pin </Label>
                                        <Label Content="{Binding Path=pinName}"></Label>
                                        <Label> is </Label>
                                        <ComboBox Width="80" SelectedIndex="0">
                                            <ComboBoxItem>HIGH</ComboBoxItem>
                                            <ComboBoxItem>LOW</ComboBoxItem>
                                            <ComboBoxItem>RISING</ComboBoxItem>
                                            <ComboBoxItem>FALLING</ComboBoxItem>
                                        </ComboBox>
                                    </StackPanel>
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                        </ItemsControl> -->
                        <!-- Analog Pins-->
                        <!--
                        <ItemsControl  BorderThickness="0" Name="analogPins" Width="400" Height="400" ItemsSource="{Binding ElementName=root, Path=analog_pin_items}">
                            <ItemsControl.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel Orientation="Vertical"></StackPanel>
                                </ItemsPanelTemplate>
                            </ItemsControl.ItemsPanel>
                            <ItemsControl.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <CheckBox IsChecked="{Binding Path=isChecked}"></CheckBox>
                                        <Label>Pin</Label>
                                        <Label Content="{Binding Path=pinName}"></Label>
                                        <Label>is</Label>
                                        <ComboBox Width="80" SelectedIndex="0">
                                            <ComboBoxItem>EQUALS</ComboBoxItem>
                                            <ComboBoxItem>GREATER</ComboBoxItem>
                                            <ComboBoxItem>LOWER</ComboBoxItem>                                     
                                        </ComboBox>
                                        <TextBox Text="{Binding setValue}" Width="50"></TextBox>
                                    </StackPanel>
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                        </ItemsControl>
                    </StackPanel> -->
                </ScrollViewer>
            </StackPanel>
        </StackPanel>
    </Grid>
</src:IWpfConfiguration>
